class BugList < ActiveRecord::Base
  belongs_to :project
  belongs_to :scope_filter
  belongs_to :ownership_model
  
  validates_presence_of :display_name
  validates_presence_of :expert_query
    

  ##
  # Tells Active record the name it should use when displaying
  # a bug list is the display_name and not the name field.
  def to_label
    self.display_name
  end  
    
  ##
  # renders the column order as csv. This should be 
  # replaced in the future such that columns more 
  # visually appealing
  def table_columns_order_as_csv
    BugColumnsHelper.format_columns_for_generator(self.table_column_order)    
  end
end
